using Tarantino.Core.Commons.Services.Security;
using Tarantino.Core.Commons.Services.Security.Impl;
using Tarantino.Samples.Core.Model;
using NUnit.Framework;

namespace Tarantino.Samples.Infrastructure.IntegrationTests.DataAccess.Mappings
{
	[TestFixture]
	public class Z_DataLoaderTester : DatabaseTester
	{
		[Test]
		public void Can_add_several_users()
		{
			IEncryptionEngine engine = new AesEncryptionEngine();
			string encryptedPassword = engine.Encrypt("pass");

			SystemUser jeffrey = new SystemUser();
			jeffrey.FirstName = "Jeffrey";
			jeffrey.LastName = "Palermo";
			jeffrey.EmailAddress = "jpalermo@hotmail.com";
			jeffrey.EncryptedPassword = encryptedPassword;

			SystemUser eric = new SystemUser();
			eric.FirstName = "Eric";
			eric.LastName = "Hexter";
			eric.EmailAddress = "ehexter@hotmail.com";
			eric.EncryptedPassword = encryptedPassword;

			SystemUser stephen = new SystemUser();
			stephen.FirstName = "Stephen";
			stephen.LastName = "Balkum";
			stephen.EmailAddress = "sbalkum@hotmail.com";
			stephen.EncryptedPassword = encryptedPassword;

			SystemUser kevin = new SystemUser();
			kevin.FirstName = "Kevin";
			kevin.LastName = "Hurwitz";
			kevin.EmailAddress = "khurwitz@hotmail.com";
			kevin.EncryptedPassword = encryptedPassword;

			SaveAndFlushSessionFor(jeffrey, eric, stephen, kevin);
		}
	}
}